//
//  NSString+JHBase64.m
//  练习MD5加密
//
//  Created by 苗钧豪 on 16/8/16.
//  Copyright © 2016年 苗钧豪. All rights reserved.
//

#import "NSString+JHBase64.h"

@implementation NSString (JHBase64)
- (NSString *)stringWithBase64 {
    NSData *stringData = [self dataUsingEncoding:NSUTF8StringEncoding];
    NSString *base64String = [stringData base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength];
    return base64String;
}
- (NSString *)Base64WithString {
    NSData *base64Data = [[NSData alloc]initWithBase64EncodedString:self options:NSDataBase64DecodingIgnoreUnknownCharacters];
    NSString *orginString = [[NSString alloc]initWithData:base64Data encoding:NSUTF8StringEncoding];
    return orginString;
}
@end
